import classNames from 'classnames';
import classes from './index.module.css';

type Props = React.HTMLAttributes<HTMLOrSVGElement> & {
  icon: string;
};

const Icon: React.FC<Props> = ({ icon, ...props }) => {
  return (
    <svg
      aria-hidden="true"
      {...props}
      className={classNames(classes.icon, props.className)}
    >
      <use xlinkHref={`#${icon}`}></use>
    </svg>
  );
};

export default Icon;
